<%@page import="java.util.Locale"%>
<%@page import="java.util.ResourceBundle"%>
<%@page import="java.util.Random"%>
<%@page import="entity.Author"%>
<%@page import="util.Seo"%>
<%@page import="java.util.List"%>
<% 
	request.setCharacterEncoding("utf-8");
	response.setHeader("Content-Type","text/html; charset=utf-8");
	response.setHeader("Vary","Accept-Encoding");
	response.setCharacterEncoding("utf-8");
%>
<%
	HttpSession ss = request.getSession(true);
	ResourceBundle resource = (ResourceBundle) ss.getAttribute("language");
	int currentPage = Integer.valueOf(request.getAttribute("currentPage").toString());
	String language = resource.getString("code");
%>
<%
	List<Author> list = (List<Author>) request.getAttribute("listAuthor");
	String title = resource.getString("page")+" "+(currentPage+1)+" - "+resource.getString("list_author");
	String description = title+Seo.description(language);
	String keywords = Seo.keyword(language);
	String tag = "user";
	String path = request.getContextPath();
%>
<jsp:include page="layout/header.jsp">
	<jsp:param name="title" value="<%=title %>"/>
	<jsp:param name="description" value="<%=description %>"/>
	<jsp:param name="keywords" value="<%=keywords %>"/>
	<jsp:param name="language" value="<%=language %>"/>
	<jsp:param name="tag" value="<%=tag %>"/>
</jsp:include>

<div class="bd">
	<h2 class="tt"><%=resource.getString("list_author")%></h2>

	<ul class="lat">
		<%
			for (Author author : list) {
		%>
		<li>
			<img alt="author" src="<%=path%>/images/<%=author.getAvatar() %>" /> 
				<a href="<%=path%>/<%=language%>/author/<%=author.getAlias()%>">
					<%=author.getName()%>
				</a>
				<%=resource.getString("menu_question")%> : <span class="it"><a href="#"><%=author.getCountQuestion()%></a></span><br />
				<%=resource.getString("answer")%> : <span class="it"><a href="#"><%=author.getCountAnswer()%></a></span>
		</li>
		<%
			}
		%>
		<li class="paginate">
			<%
				if(currentPage>0){
				%>							
					<a href="<%=path%>/<%=language%>/list-authors/<%=currentPage-1%>">Previous</a>
				<%							
				}
			%>					
			<a href="<%=path%>/<%=language%>/list-authors/<%=currentPage+1%>">Next</a>
		</li>
	</ul>
	<div class="clear"></div>
</div>
<jsp:include page="/layout/footer.jsp">
	<jsp:param name="language" value="<%=language %>" />
</jsp:include>
